package com.quanfaqiang.demo1.controller;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import java.io.IOException;

@RestController
public class SimpleCaptchaController {

    @GetMapping("/testresponse")
    public void testResponse(HttpServletResponse response) throws IOException {
        response.getWriter().write("Response is working fine");
    }

    @GetMapping("/testrequest")
    public String testRequest(HttpServletRequest request) {
        return "Request received with session ID: " + request.getSession().getId();
    }
}
